﻿using System;
using System.ComponentModel.Composition;
using System.Threading;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Threading;
using Fluent;

namespace PefStudio.Windows
{
    [Export(MainWindow.RibbonTabsContract, typeof(IRibbonContextualTabGroup))]
    public partial class Group1TabItem : AbstractRibbonContextualTabGroup
    {
        public const string Contract = "First";

        public Group1TabItem()
        {
            BaseContract = Contract;

            Header = "First";
            ID = "First";

            BorderBrush = Brushes.Magenta;
            Background = Brushes.Purple;
            Visibility = Visibility.Visible;
        }
    }

    [Export(MainWindow.RibbonTabsContract, typeof(IRibbonContextualTabGroup))]
    public partial class Group2TabItem : AbstractRibbonContextualTabGroup
    {
        public const string Contract = "Second";

        public Group2TabItem()
        {
            BaseContract = Contract;

            Header = "Second";
            ID = "Second";

            BorderBrush = Brushes.Green;
            Background = Brushes.Lime;
            Visibility = Visibility.Visible;
        }
    }

    [Export(Group1TabItem.Contract, typeof(IRibbonTabItem))]
    [Export(MainWindow.RibbonTabsContract, typeof(IRibbonTabItem))]
    public partial class FormatTabItem : AbstractRibbonTabItem
    {
        public const string Contract = "Format";

        public FormatTabItem()
        {
            BaseContract = Contract;

            Header = "Format";
            ID = "Format";

            InitializeComponent();
        }
    }

    [Export(Group2TabItem.Contract, typeof(IRibbonTabItem))]
    [Export(MainWindow.RibbonTabsContract, typeof(IRibbonTabItem))]
    public partial class DesignTabItem : AbstractRibbonTabItem
    {
        public const string Contract = "Design";

        public DesignTabItem()
        {
            BaseContract = Contract;

            Header = "Design";
            ID = "Design";

            //InitializeComponent();
        }
    }

    [Export(Group2TabItem.Contract, typeof(IRibbonTabItem))]
    [Export(MainWindow.RibbonTabsContract, typeof(IRibbonTabItem))]
    public partial class LayoutTabItem : AbstractRibbonTabItem
    {
        public const string Contract = "Layout";

        public LayoutTabItem()
        {
            BaseContract = Contract;

            Header = "Layout";
            ID = "Layout";

            //InitializeComponent();
        }
    }

    [Export(MainWindow.RibbonToolBarsContract, typeof(IRibbonChildItem))]
    public partial class HelpRibbonButton : AbstractRibbonButton
    {
        public HelpRibbonButton()
        {
            Header = "Help";
            ID = "Help";

            Size = RibbonControlSize.Small;

            InitializeComponent();
        }

        protected override void OnClick()
        {
            //if (tabGroup1.Visibility == Visibility.Visible)
            //{
            //    tabGroup1.Visibility = Visibility.Collapsed;
            //    tabGroup2.Visibility = Visibility.Collapsed;
            //}
            //else
            //{
            //    tabGroup1.Visibility = Visibility.Visible;
            //    tabGroup2.Visibility = Visibility.Visible;
            //}
        }
    }
}
